
import Vue from 'vue';
import { Toast,Dialog } from 'vant';

//全局组件注册
Vue.use(Toast);
Vue.use(Dialog);

//loading动画
Vue.prototype.loading = (message = '加载中...', overlay = false) => {
    return Toast.loading({
        duration: 0,
        forbidClick: true,
        overlay: overlay,
        message: message,
    })
}


//运行环境
Vue.prototype.mobile = {
    isIos: () => "IOS" === process.env.VUE_APP_MOBILE,
    isAndroid: () => "Android" === process.env.VUE_APP_MOBILE,
    isDev: () => "DEV" === process.env.VUE_APP_MOBILE
}





